import type { AddressParams } from '@/types/address'
import { http } from '@/utils/http'

// 添加收货地址
export const postMemberAddressAPI = (data: AddressParams) => {
  return http({
    method: 'POST',
    url: '/member/address',
    data,
  })
}
// 获取收货地址
export const getMemberAddressAPI = () => {
  return http({
    url: '/member/address',
    method: 'GET',
  })
}
// 获取地址详情（用于修改地址）
export const getMemberAddressByIdAPI = (id: any) => {
  return http({
    method: 'GET',
    url: `/member/address/${id}`,
  })
}
// 修改用户地址
export const putMemberAddressAPI = (id: string, data: any) => {
  return http({
    method: 'PUT',
    url: `/member/address/${id}`,
    data,
  })
}
